//
//  UILabel+Contenlable.m
//  TTInternbird
//
//  Created by 耿文康 on 16/3/22.
//  Copyright © 2016年 耿文康. All rights reserved.
//

#import "UILabel+Contenlable.h"

@implementation UILabel (Contenlable)

-(instancetype)initWithTitle:(NSString *)title color:(UIColor *)color sizeFont:(CGFloat)font {
    
    UILabel *lable =[[UILabel alloc] init];
    
    lable.text = title;
    
    lable.textColor = color;
    
    lable.font = [UIFont systemFontOfSize:font];
    [lable sizeToFit];
    return lable;
}

-(instancetype)initWithTitle:(NSString *)title color:(UIColor *)color sizeFont:(CGFloat)font layoutWidth:(CGFloat)layoutWidth{
    
    
    UILabel *lable =[[UILabel alloc] init];
    
    lable.text = title;
    
    lable.textColor = color;
    
    lable.font = [UIFont systemFontOfSize:font];
    
    if (layoutWidth>0) {
        
        lable.preferredMaxLayoutWidth= layoutWidth;
        lable.numberOfLines=0;
    }
    
    
    //    [lable sizeToFit];
    return lable;
}



@end
